package obj.day3.test2;

/**
 * @author げっしょく
 * @date 2021/7/18
 */
public class Inspeak {
    public static void main(String[] args) {
        usespeak(new Speak() {
            @Override
            public void hello(String name) {
                System.out.println(name + " zhu zai ni jia ge bi!!");
            }
        });    //这是形参
        usespeak(name ->          //这是方法覆盖的方法体
            System.out.println(name +" rang ni zhu yi ni de lao pao")
        );
        usespeak(name -> System.out.println("ke neng hui bei tou zou"));
    }
    public static void usespeak(Speak s){
        s.hello("lao wang");//实参是lao wang
    }
}

interface Speak{
    void hello(String name);
}
